package com.mask.swag.controller;

import com.mask.swag.entity.UserEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName HelloController
 * Create by hx
 * Date 2021/8/7 4:02 下午
 */
@Api(tags = "测试swagger控制类")
@RestController
public class HelloController {

    @ApiOperation("post测试")
    @PostMapping(value = "/post/test")
    public UserEntity postTest(@ApiParam("用户名") UserEntity userEntity){
        return userEntity;
    }

    @ApiOperation("Hello控制类")
    @GetMapping(value = "/hello")
    public String hello(@ApiParam("用户名") String username){
        return "hello" + username;
    }

    @PostMapping(value = "/user")
    public UserEntity userEntity(){
        return new UserEntity();
    }
}
